package com.fucheng.common;

import lombok.Builder;
import lombok.Data;

import java.io.Serializable;

/**
 * 定义RpcRequest对象，封装方法名、类名、参数、参数类型
 */
@Data
@Builder
public class RpcRequest implements Serializable {

    // 服务类名，客户端只知道接口名，在服务端中用接口名指向实现类
    private String interfaceName;
    // 方法名
    private String methodName;
    // 参数列表
    private Object[] params;
    // 参数类型
    private Class<?>[] paramsTypes;

    // 版本号
    private String version;
    // 服务名
    private String serviceName;

    public RpcRequest(){}

    public RpcRequest(String interfaceName, String methodName, Object[] params, Class<?>[] paramsTypes, String version, String serviceName) {
        this.interfaceName = interfaceName;
        this.methodName = methodName;
        this.params = params;
        this.paramsTypes = paramsTypes;
        this.version = version;
        this.serviceName = serviceName;
    }

}
